import request from '@/utils/request'

export function listProduct(query) {
  return request({
    url: '/webproduct/list',
    method: 'get',
    params: query
  })
}

export function deleteProduct(data) {
  return request({
    url: '/webproduct/delete',
    method: 'post',
    data
  })
}

export function publishProduct(data) {
  return request({
    url: '/webproduct/create',
    method: 'post',
    data
  })
}

export function detailProduct(id) {
  return request({
    url: '/webproduct/detail',
    method: 'get',
    params: { id }
  })
}

export function editProduct(data) {
  return request({
    url: '/webproduct/update',
    method: 'post',
    data
  })
}

export function listCategory() {
  return request({
    url: '/webproduct/productcategory',
    method: 'get'
  })
}
